package org.study.itcast.socket;

import com.google.common.base.Charsets;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.channels.SocketChannel;

/**
 * @author: jzhou
 * @date: 2024/4/21-20:47
 * @version: 1.0
 * @description: spark3.3-study
 */
public class Client {
    public static void main(String[] args) throws IOException {
        SocketChannel sc = SocketChannel.open();
        sc.connect(new InetSocketAddress("localhost", 8080));
        sc.write(Charsets.UTF_8.encode("hello"));
//        System.out.println("waiting...");
        System.in.read();
    }
}
